package com.xjc.market.acct.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.xjc.infra.base.BaseService;
import com.xjc.infra.entity.SessionContext;
import com.xjc.market.acct.biz.MenuBiz;
import com.xjc.market.acct.entity.UserObjectEntity;
import com.xjc.market.acct.entity.table.AcMenu;
import com.xjc.market.frame.util.FrameUtil;

/**
 * 菜单-服务
 * @author liangcz
 * @Date   2017年9月5日 下午5:26:09
 * @version 1.0
 */
@RestController
@Controller
@RequestMapping("/acct/service/MenuService")
public class MenuService extends BaseService{
	@Autowired
	MenuBiz menuBiz;
	/**
	 * 查询用户菜单
	 * @author liangcz
	 * @date   2017年9月6日 下午2:06:48
	 * @return void
	 */
	@ResponseBody
	@RequestMapping("/inquiryMenu")
	public List<AcMenu> inquiryMenu(SessionContext sessionContext,
			HttpServletRequest request, HttpServletResponse response){
		UserObjectEntity userObjectEntity = FrameUtil.getUserObject(request.getSession());
		String userid = userObjectEntity.getAcOperator().getUserid();
		List<AcMenu> acMenuList = menuBiz.inquiryMenu(userid);
		return acMenuList;
	}
}
